package net.oschina.app.Page;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import net.oschina.app.SoloWrap;

/**
 * Created by kola on 2017/3/23.
 * 我的页面登陆page类抽取
 */

public class PageMyLogin {
    private SoloWrap solo;
    TextView userName;
    ImageView settings;


    public PageMyLogin(SoloWrap solo) {

        this.solo = solo;
    }

    public void initViews() {
        solo.waitForText("我的团队");
//        用户名
        userName = (TextView) solo.getView("net.oschina.app:id/tv_nick");
//        设置
        settings = (ImageView) solo.getView("net.oschina.app:id/iv_logo_setting");


    }

    public void clickOnSettings() {

        solo.clickOnView(settings);
    }

    public String getuserName() {

        return userName.getText().toString();

    }

    public boolean isLoginStatus() {
        if (userName.isShown() && "kola73".equals(getuserName())) {
            return true;
        }
        return false;

    }
}
